package com.hudilao.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hudilao.common.R;
import com.hudilao.dto.CustomerMembershipDTO;
import com.hudilao.dto.MembershipRegisterLoginDTO;
import com.hudilao.entity.CustomerMembership;

import java.math.BigDecimal;

public interface CustomerMembershipService extends IService<CustomerMembership> {
    R<String> register(MembershipRegisterLoginDTO membershipRegisterLoginDTO, long customerId);
    void updateCustomerBalance(long id, BigDecimal balance);

    Page<CustomerMembershipDTO> getMembers(int page, int pageSize, String name);

    boolean updateBalance(Long memberId, BigDecimal amount);

    boolean decreaseBalance(Long memberId, BigDecimal amount);

}
